/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Logica;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author User
 */
@Entity
@Table(name = "persona_apoyo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PersonaApoyo.findAll", query = "SELECT p FROM PersonaApoyo p"),
    @NamedQuery(name = "PersonaApoyo.findByIdPersona", query = "SELECT p FROM PersonaApoyo p WHERE p.idPersona = :idPersona"),
    @NamedQuery(name = "PersonaApoyo.findByNombre", query = "SELECT p FROM PersonaApoyo p WHERE p.nombre = :nombre"),
    @NamedQuery(name = "PersonaApoyo.findByCargo", query = "SELECT p FROM PersonaApoyo p WHERE p.cargo = :cargo"),
    @NamedQuery(name = "PersonaApoyo.findByTelefono", query = "SELECT p FROM PersonaApoyo p WHERE p.telefono = :telefono"),
    @NamedQuery(name = "PersonaApoyo.findByDireccion", query = "SELECT p FROM PersonaApoyo p WHERE p.direccion = :direccion"),
    @NamedQuery(name = "PersonaApoyo.findByEmail", query = "SELECT p FROM PersonaApoyo p WHERE p.email = :email")})
public class PersonaApoyo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_persona")
    private String idPersona;
    @Column(name = "nombre")
    private String nombre;
    @Column(name = "cargo")
    private String cargo;
    @Column(name = "telefono")
    private String telefono;
    @Column(name = "direccion")
    private String direccion;
    @Column(name = "email")
    private String email;
    @ManyToMany(mappedBy = "personaApoyoCollection")
    private Collection<Competencia> competenciaCollection;

    public PersonaApoyo() {
    }

    public PersonaApoyo(String idPersona) {
        this.idPersona = idPersona;
    }

    public String getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(String idPersona) {
        this.idPersona = idPersona;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getCargo() {
        return cargo;
    }

    public void setCargo(String cargo) {
        this.cargo = cargo;
    }

    public String getTelefono() {
        return telefono;
    }

    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @XmlTransient
    public Collection<Competencia> getCompetenciaCollection() {
        return competenciaCollection;
    }

    public void setCompetenciaCollection(Collection<Competencia> competenciaCollection) {
        this.competenciaCollection = competenciaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPersona != null ? idPersona.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PersonaApoyo)) {
            return false;
        }
        PersonaApoyo other = (PersonaApoyo) object;
        if ((this.idPersona == null && other.idPersona != null) || (this.idPersona != null && !this.idPersona.equals(other.idPersona))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Logica.PersonaApoyo[ idPersona=" + idPersona + " ]";
    }
    
}
